﻿namespace WinForms
{
    using AxWMPLib;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.IO;
    using System.Reflection;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms.Properties;

    public class FrmFalshPlay : Form
    {
        private Button btn_Close;
        private Button btn_fullPing;
        private IContainer components;
        public const int HTCAPTION = 2;
        private Label lblTitle;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_Button;
        private Panel panel1;
        public const int SC_MOVE = 0xf010;
        private WebBrowser webBrowser1;
        public const int WM_SYSCOMMAND = 0x112;
        private AxWindowsMediaPlayer wmplay;

        public FrmFalshPlay()
        {
            this.components = null;
            this.InitializeComponent();
        }

        public FrmFalshPlay(string address)
        {
            this.components = null;
            this.InitializeComponent();
            string str = Directory.GetParent(Assembly.GetExecutingAssembly().Location) + @"\" + address;
            this.wmplay.URL = str;
            this.wmplay.Ctlcontrols.play();
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btn_fullPing_Click(object sender, EventArgs e)
        {
            if (this.wmplay.fullScreen)
            {
                this.wmplay.fullScreen = false;
            }
            else
            {
                this.wmplay.fullScreen = true;
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmFalshPlay_FormClosed(object sender, FormClosedEventArgs e)
        {
            try
            {
                this.wmplay.Ctlcontrols.stop();
                this.wmplay.close();
            }
            catch (Exception)
            {
            }
        }

        private void InitializeComponent()
        {
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmFalshPlay));
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.panel1 = new Panel();
            this.wmplay = new AxWindowsMediaPlayer();
            this.webBrowser1 = new WebBrowser();
            this.panel_Button = new Panel();
            this.btn_Close = new Button();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.btn_fullPing = new Button();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            this.panel1.SuspendLayout();
            this.wmplay.BeginInit();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x26a);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x3ed, 0x26a);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x3eb, 0x269);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x3d7, 0x255);
            this.pan_AllPlanes.TabIndex = 4;
            this.panel1.Controls.Add(this.wmplay);
            this.panel1.Controls.Add(this.webBrowser1);
            this.panel1.Dock = DockStyle.Fill;
            this.panel1.Location = new Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x3d7, 560);
            this.panel1.TabIndex = 12;
            this.wmplay.Dock = DockStyle.Fill;
            this.wmplay.Enabled = true;
            this.wmplay.Location = new Point(0, 0);
            this.wmplay.Name = "wmplay";
            this.wmplay.OcxState = (AxHost.State) resources.GetObject("wmplay.OcxState");
            this.wmplay.Size = new Size(0x3d7, 560);
            this.wmplay.TabIndex = 1;
            this.webBrowser1.Dock = DockStyle.Fill;
            this.webBrowser1.Location = new Point(0, 0);
            this.webBrowser1.MinimumSize = new Size(20, 20);
            this.webBrowser1.Name = "webBrowser1";
            this.webBrowser1.Size = new Size(0x3d7, 560);
            this.webBrowser1.TabIndex = 0;
            this.panel_Button.Controls.Add(this.btn_fullPing);
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 560);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(0x3d7, 0x25);
            this.panel_Button.TabIndex = 11;
            this.btn_Close.Location = new Point(0x200, 7);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0xb7, 0x17);
            this.btn_Close.TabIndex = 6;
            this.btn_Close.Text = "关   闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x3e1, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x255);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x255);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x25f);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x3eb, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x3eb, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x269);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x3eb, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x3ec, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x26a);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x3ed, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x3c9, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x23, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "帮助";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x3e8, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            this.btn_fullPing.Location = new Point(0x120, 7);
            this.btn_fullPing.Name = "btn_fullPing";
            this.btn_fullPing.Size = new Size(0xb7, 0x17);
            this.btn_fullPing.TabIndex = 7;
            this.btn_fullPing.Text = "全   屏";
            this.btn_fullPing.UseVisualStyleBackColor = true;
            this.btn_fullPing.Click += new EventHandler(this.btn_fullPing_Click);
            base.AcceptButton = this.btn_Close;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x3ed, 650);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            this.DoubleBuffered = true;
            base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmFalshPlay";
            base.ShowInTaskbar = false;
            base.FormClosed += new FormClosedEventHandler(this.FrmFalshPlay_FormClosed);
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.wmplay.EndInit();
            this.panel_Button.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 0, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
    }
}

